<template>
  <el-drawer
    @close="close"
    title="我是标题"
    :visible.sync="drawer"
    :with-header="false"
    direction="btt"
    size="80%"
  >
    <div class="flex">
      <div class="left">
        <div v-for="(item, index) in annexInfo" :key="index">
          <span class="span_class">{{ item.annexName }}</span>
          <li v-for="(items, i) in item.annexFiles" :key="i">
            <img
              class="img_class"
              :src="file(items)"
              alt=""
              @click="da(index), open(items)"
            />
          </li>
        </div>
      </div>
      <div class="right">
        <div v-for="(item, index) in annexHitList" :key="index">
          <div v-for="(items, i) in item.hitList" :key="i">
            <div v-for="(itemss, ii) in items.list" :key="ii">
              <template>
                <h4>hitInfo-----</h4>
                <p>{{ itemss.hitInfo }}</p>
                <h4>coordinateInfos-----</h4>
                <p v-for="(itemsss, iii) in itemss.coordinateInfos" :key="iii">
                  <span>
                    {{ itemsss }}
                  </span>
                </p>
              </template>
              <br /><br />
            </div>
          </div>
        </div>
        {{ list }}
        <h3>财产描述：</h3>
        <p>
          {{ text }}
        </p>

        <img :src="file(img)" alt="" />
      </div>
    </div>
  </el-drawer>
</template>

<script>
export default {
  props: ['drawer', 'annexDetailInfo', 'propertyHitInfo'],
  watch: {
    annexDetailInfo: {
      handler(val) {
        console.log(val);
        if (val) {
          this.annexInfo = val.annexInfo;
          this.annexHitList = val.annexHitList;
          this.img = this.annexInfo[0].annexFiles[0];
        }
      },
      deep: true,
      immediate: true,
    },
    propertyHitInfo: {
      handler(val) {
        console.log(val);
        if (val) {
          this.list = val.list;
          this.text = val.text;
        }
      },
      deep: true,
      immediate: true,
    },
  },
  data() {
    return {
      img: '',
      num: 0,
      annexInfo: [],
      annexHitList: [],
      list: [],
      text: '',
    };
  },

  mounted() {},
  methods: {
    da(i) {
      console.log(i);
      this.num = i;
    },
    file(name) {
      return (
        'https://beefeather.llschain.com/file-handle-web/file/image?filename=' +
        encodeURIComponent(name)
      );
    },
    open(name) {
      let file =
        'https://beefeather.llschain.com/file-handle-web/file/image?filename=' +
        name;
      console.log(
        'https://beefeather.llschain.com/file-handle-web/file/image?filename=' +
          encodeURIComponent(name)
      );

      this.img = name;
      // window.open(file);
      // https://beefeather.llschain.com/file-handle-web/file/image?filename=%2Fhome%2Flls_data%2Fproduct%2Fzhongdeng%2Fpicture%2F%E6%B9%96%E5%8D%97%E5%BC%98%E6%AF%85%E8%B4%B8%E6%98%93%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8%2F19996835002475428573%2F%E4%BB%98%E6%AC%BE%E6%89%BF%E8%AF%BA%E5%87%BD%2B%E7%94%B5%E5%AD%90%E5%80%BA%E6%9D%83%E5%87%AD%E8%AF%81%2F%E4%BB%98%E6%AC%BE%E6%89%BF%E8%AF%BA%E5%87%BD%2B%E7%94%B5%E5%AD%90%E5%80%BA%E6%9D%83%E5%87%AD%E8%AF%81__1.png
      // https://beefeather.llschain.com/file-handle-web/file/image?filename=/home/lls_data/product/zhongdeng/picture/%E6%B9%96%E5%8D%97%E5%BC%98%E6%AF%85%E8%B4%B8%E6%98%93%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8/19996835002475428573/%E4%BB%98%E6%AC%BE%E6%89%BF%E8%AF%BA%E5%87%BD+%E7%94%B5%E5%AD%90%E5%80%BA%E6%9D%83%E5%87%AD%E8%AF%81/%E4%BB%98%E6%AC%BE%E6%89%BF%E8%AF%BA%E5%87%BD+%E7%94%B5%E5%AD%90%E5%80%BA%E6%9D%83%E5%87%AD%E8%AF%81__1.png
    },
    close() {
      console.log('哦哦哦哦');
      this.$emit('handle', false);
    },
  },
};
</script>

<style scoped>
.span_class {
  font-size: 14px;
}
.img_class {
  width: 150px;
}

.flex {
  display: inline-flex;
}

.left {
  width: 30%;
}
.right {
  width: 70%;
}
</style>
